Test-Series - programming logic

Test Number 15/15

Q: Can any function call itself?

A. No
B. Runtime Error
C. Yes
D. Compilation Error
Solution: The correct answer is:
Yes
Q: What is the output of the below program?

int main()

{

  int a=10;

  int b,c;

  b = a++;

  c = a;

  cout<
A. 111111
B. 111011
C. 101010
D. 101011
Solution: The correct answer is:
111011
Q: Which operator has highest precedence?
A. ()
B. *
C. =
D. ++
Solution: The correct answer is:
()
Q: Choose the option that contains only valid hexadecimal integers.
A. 0x9F, 0xbcd, 0x1
B. 037, 00x, 01000
C. 0x561u, 0x9h, 0xdd
D. H9F, HFF, HAA
Solution: The correct answer is:
H9F, HFF, HAA
Q: A sorting algorithm traverses through a list, comparing adjacent elements and switching them under certain conditions. What is this sorting algorithm called?
A. insertion sort
B. bubble sort
C. quick sort
D. quick sort
Solution: The correct answer is:
bubble sort
Q: What is the output of the below program?

int main()

{

  const int a=10;

  a++;

  cout<
A. Linking Error
B. 11
C. 10
D. Compilation Error
Solution: The correct answer is:
Compilation Error
Q: What is the output of the below program?

int main()

{

int a = 10;

cout<
A. 10
B. Not defined
C. 12
D. 11
Solution: The correct answer is:
10
Q: What is the value of a in the below program?

int main()

{

 int a, b=20;

 a = 90/b;

 return 0;

}
A. 4
B. 4.0
C. 4.5
D. Compilation Error
Solution: The correct answer is:
4
Q: In the following sorting procedures, which one will be the slowest for any given array?
A. Quick sort
B. Merge Sort
C. Heap sort
D. Bubble sort
Solution: The correct answer is:
Bubble sort
Q: What is the output of below program?

class base

{

public:

       base()

       {          

           cout<<"BCon";

       }

       ~base()

       {

	   cout<<"BDest ";

       }

};

class derived: public base

{

public:

       derived()

       {     cout<<"DCon ";

       }

       ~derived()

       {     cout<<"DDest ";

       }

};



int main()

{

derived object;

return 0; 

}
A. BCon DCon DDest BDest
B. Dcon DDest BCon BDest
C. Dcon DDest
D. BCon DCon BDes DDest
Solution: The correct answer is:
BCon DCon DDest BDest

You Have Score    /10